package org.xfc.editor;

import java.awt.BorderLayout;

import org.xfc.XApp;
import org.xfc.XAppFrame;
import org.xfc.testing.XMockApp;
import org.xfc.testing.XUITestCase;

public class XStringEditorTest
	extends XUITestCase
{

	protected void setUp()
		throws Exception
	{
		XMockApp.init();
		
		waitFor(locateShowing(XApp.getApp().getAppName()));
	}

	protected void tearDown()
		throws Exception
	{
		XMockApp.dispose();
	}

	public void testGetValue()
	{
		XStringEditor editor = new XStringEditor();
		
		editor.setValue("");
		
		XAppFrame frame = XApp.getApp().getActiveAppFrame();
		
		frame.add(editor, BorderLayout.CENTER);
		frame.pack();
		
		type(editor.getTextField(), "New value");
		
		assertThat("New value", eq(editor.getValue()));
	}

}
